#ifndef NANE_ASSERT_H
#   define NANE_ASSERT_H

#   include "nane/core/crt/Context.h"

#   define STRINGIFY(x) #x
#   define TOSTRING(x) STRINGIFY(x)

#   ifndef NANE_ASSERTION_ENABLED
#   define NANE_ASSERTION_ENABLED 0
#   endif

#   if NANE_ASSERTION_ENABLED
#       define NANE_ASSERT( cond, desc ) { if(!(cond)) nane::m_context->errorHandler(desc, __FILE__, TOSTRING(__LINE__), __FUNCTION__); }
#       define NANE_ASSERT_R( cond, desc ) { if(!(cond)) {nane::m_context->errorHandler(desc, __FILE__, TOSTRING(__LINE__), __FUNCTION__); return;} }
#       define NANE_ASSERT_RV( cond, desc, value ) { if(!(cond)) {nane::m_context->errorHandler(desc, __FILE__, TOSTRING(__LINE__), __FUNCTION__); return value;} }
#   else
#       define NANE_ASSERT( cond, desc ) (void)0
#       define NANE_ASSERT_R( cond, desc ) (void)0
#       define NANE_ASSERT_RV( cond, desc, value ) (void)0
#   endif

#endif	// NANE_ASSERT_H
